<%--
    @author Kusal Samarakoon
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript">
    $(function() {
        $('#occupier-info').hide();
        $('#addOccupier').val($('#add-occupier').val());
        if ($('#approvalState').val() == "PENDING" || $('#approvalState').val() == "APPROVED") {
            $('#add-occupier-btn').hide();
        } else {
            $('#add-occupier-btn').show();
        }
    });


</script>

<tr>
    <td colspan="4">
        <table id="occupierTable">
            <s:iterator status="status" value="land.occupiers">
                <tr>

                    <td colspan='4'>
                        <table class='width-100'>
                            <tr>
                                <td><s:label value="%{getText('name_of_occupier.label')}"/></td>
                                <td colspan='3'><s:label value="%{name}" cssClass="width-500-px"
                                                         name="%{'land.occupiers['+( #status.count-1)+'].name'}"/></td>
                            </tr>
                            <tr>
                                <td><s:label value="%{getText('date_of_birth.label')}"/></td>
                                <td><s:label value="%{dateOfBirth}"
                                             name="%{'land.occupiers['+( #status.count-1)+'].dateOfBirth'}"/></td>
                                <td><s:label value="%{getText('nic.label')}"/></td>
                                <td><s:label value="%{registrationNumberOrNIC}"
                                             name="%{'land.occupiers['+( #status.count-1)+'].registrationNumberOrNIC'}"/></td>
                            </tr>
                            <tr>
                                <td><s:label value="%{getText('address.label')}"/></td>
                                <td colspan='3'><s:label value="%{contacts.address}" cssClass="width-500-px"
                                                         name="%{'land.occupiers.['+( #status.count-1)+'].contacts.address'}"/></td>
                            </tr>
                            <tr>
                                <td><s:label value="%{getText('contact_number.label')}"/></td>
                                <td><s:label value="%{getText('mobile.label')}"/></td>
                                <td colspan='2'><s:label value="%{contacts.mobile}"
                                                         name="%{'land.occupiers.['+( #status.count-1)+'].contacts.mobile'}"/></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><s:label value="%{getText('land_line.label')}"/></td>
                                <td colspan='2'><s:label value="%{contacts.landPhone}"
                                                         name="%{'land.occupiers.['+( #status.count-1)+'].contacts.landPhone'}"/></td>
                            </tr>
                            <tr>
                                <td><s:label value="%{getText('contacts.email.label')}"/></td>
                                <td><s:label value="%{contacts.email}"
                                             name="%{'land.occupiers.['+( #status.count-1)+'].contacts.email'}"/></td>
                                <td><s:label value="%{getText('fax.label')}"/></td>
                                <td><s:label value="%{contacts.fax}"
                                             name="%{'land.occupiers.['+( #status.count-1)+'].contacts.fax'}"/></td>
                            </tr>
                        </table>

                    </td>
                </tr>
                <%--<s:hidden name="%{'alienation.holder.children[' +( #status.count-1)+'].id'}"
                          id="%{'childId' + ( #status.count-1)}"/>--%>
            </s:iterator>
        </table>
    </td>
</tr>


<s:hidden id="occupierName" value="%{getText('name_of_occupier.label')}"/>
<s:hidden id="occupierDOB" value="%{getText('date_of_birth.label')}"/>
<s:hidden id="occupierAddr" value="%{getText('address.label')}"/>
<s:hidden id="occupierNIC" value="%{getText('nic.label')}"/>
<s:hidden id="contactNo" value="%{getText('contact_number.label')}"/>
<s:hidden id="occupierMobile" value="%{getText('mobile.label')}"/>
<s:hidden id="occupierLandPhone" value="%{getText('land_line.label')}"/>
<s:hidden id="occupierEmail" value="%{getText('email.label')}"/>
<s:hidden id="occupierFax" value="%{getText('fax.label')}"/>
<s:hidden id="delete" value="%{getText('delete.label')}"/>
<s:hidden id="add-occupier" value="%{getText('add_occupier.label')}"/>

